package com.dbb.trade.entity.product;

import java.util.ArrayList;
import java.util.List;

import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.JoinColumn;
import javax.persistence.JoinTable;
import javax.persistence.OneToMany;
import javax.persistence.Table;

import com.dbb.trade.entity.AuditableEntity;
import com.dbb.trade.entity.Photo;

@Entity
@Table(name = "SIZE")
public class Size extends AuditableEntity{
	private String name;
	private String descs;
	private List<Photo> pics = new ArrayList<Photo>();
	
	public Size() { }
	
	public Size(String name) {
		this.name = name;
	}
	
	@Column(nullable = true)
	public String getName() {
		return name;
	}
	public void setName(String name) {
		this.name = name;
	}
	public String getDescs() {
		return descs;
	}
	public void setDescs(String descs) {
		this.descs = descs;
	}
	@OneToMany
	@JoinTable(
		name = "SIZE_IMAGES",
		joinColumns = @JoinColumn(name = "size_id"),
		inverseJoinColumns = @JoinColumn( name = "atta_id") 
	)
	public List<Photo> getPics() {
		return pics;
	}

	public void setPics(List<Photo> pics) {
		this.pics = pics;
	}
}
